<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>Document</title>
	</head>
	<body>
		<div id="num"></div>
		<script>
			//1. 输入一个秒数, 然后开始倒计时到0秒, 最多10000秒。
			let second = +window.prompt("请输入一个秒数");
			if (second <= 10000 && second > 0) {
				let timer = setInterval(() => {
					document.getElementById('num').innerHTML = second;
					second--;
					if (second < 0) {
						clearInterval(timer);
					}
				}, 1000)
			} else {
				console.log('请输入10000以内的秒数');
			}
		</script>


	</body>
</html>
